-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use automatic partition_labels
in new CutWire
how-to
#370
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really elegant. I like the symmetry between cut_wires
and cut_gates
. They both prepare a circuit for a gate cutting workflow. I like that we abstract the difference between gate and wire cutting immediately in our workflow.
Just a small, pedantic comment on imports here and also a suggestion we link to the wire-cutting-as-a-2q-IGate-cut appendix in the Piveteau/Sutter paper.
Thanks!
def cut_wires(circuit: QuantumCircuit, /) -> QuantumCircuit: | ||
"""Transform all :class:`.CutWire` instructions in a circuit to :class:`.Move` instructions marked for cutting. | ||
|
||
The returned circuit will have one newly allocated qubit for every :class:`.CutWire` instruction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we link to the Piveteau/Sutter LOCC wire cutting paper appendix here? THey do a nice explanation of wire cutting as a 2q identity cut / move operation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should go in an explanation at some point, but good idea -- I've added it here for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I plan on making a milestone for tidying up the docs by using more links out to explanation (especially in cutting tutorials. they're very verbose.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you mean issue, rather than milestone? We can add such an issue to the 0.3.1 milestone.
Co-authored-by: Caleb Johnson <[email protected]>
Pull Request Test Coverage Report for Build 5903504761
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, outside an underscore I couldn't explain
This introduces a
cut_wires
function, as suggested at #326 (comment), which is the one remaining piece (beyond #368) that is needed to make it so wire cuts can be specified byCutWire
s alone, without having also to provide the correctpartition_labels
.I've opened this as a PR against the branch in #368 so GitHub will show only the changes that are unique to this PR. I still think, however, that #368 should be merged first and then this should go in after it, since they are each logical, discrete changes.